Skip to main content

newImage

Type

message

Summary

Sent to a new image right after it's created.

Syntax

newImage

Description

Handle the newImage message if you want to create additional objects, switch tools, or do other tasks when a new image is created.

Normally, the newImage message is handled at a higher level of the message path, since the newly-created image does not yet have a script unless the templateImage contains one.

The actual creation is not triggered by the newImage message, so trapping the message and not allowing it to pass does not prevent the image from being created.

Examples

on newImage -- assign a file to a referenced image
if the text of the target is empty then -- no painted pixels
answer file "Please choose an image to display:"
set the filename of the target to it
end if
end newImage

command: copy, clone, paste

control structure: pass

glossary: object, trap, image, message, tool, message path

keyword: templateImage, image

property: script

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?